home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
bbs_game
/
bang21.zip
/
BANG.SRC
< prev
next >
Wrap
Text File
|
1996-04-19
|
16KB
|
542 lines
# ┌────────[ BANG Ver 2.1 - The Russian Roulette Credit Lottery ]────────────┐
# │ │
# │ Version: 2.1 (Released 14 Apr 1996) for SBBS 2.20 - Rev B │
# │ Author: Robert Nykvist aka Chuckles@LAUGHBOX │
# │ Support BBS: The Chuckle Box BBS (334) 653-1888 │
# │ │
# │ Quick Start: 1. Move BANG.SRC to your \EXEC directory. │
# │ 2. Edit to customize BANG.SRC as you see fit. │
# │ 3. Compile BANG.SRC with BAJA compiler. │
# │ 4. Make script available to your users. │
# │ │
# │ WARNING: This script changes user credits, uses file I/O │
# │ to create a log, and will HANGUP on a user. │
# │ Carefully check entire script for proper paths! │
# │ │
# │ Original Script by: Charles McColm (Oct 1995) │
# └──────────────────────────────────────────────────────────────────────────┘
!INCLUDE SBBSDEFS.INC
!INCLUDE FILE_IO.INC
# DEFINE VARIABLES
# Counter Variable for Loops
int COUNT
# Chamber Variable. Bullet is in this CHAMBER (1-6)
int CHAMBER
# Rounds Variable. How many times to pull the Trigger (Rounds to shoot)
int ROUNDS
# Variable to keep track of Credit WINNINGS.
int WINNINGS
# Track Play Variable. How many times did they play?
int trackplay
# File Variable - Keeps LOG of Victims.
int FILE
# Variable to get Time/Date
int T
# Initialize Winnings & TrackPlay
set WINNINGS 0
set TRACKPLAY 0
# Top of Menu - Check for User Credits.
:top
CMD_HOME
compare_ars $C !5
if_true
crlf
print "rhSorry, you don't have enough credits play today."
crlf
print "rhTry again tomorrow...n"
crlf
crlf
pause
cmd_pop
goto leave
end_if
# Display Menu
cls
crlf
crlf
print "nr ▀▄▀▄▀▄▀▄▀▄▀▄▀"
crlf
print "yh TCB BANG!"
crlf
print "nr ▄▀▄▀▄▀▄▀▄▀▄▀▄"
crlf
crlf
crlf
print "hw Russian Roulette bv2.1 wby Chuckles@LAUGHBOX"
crlf
crlf
print "hw <───n──┐"
crlf
print " hr¡n │"
crlf
print " hr∙w F - mFire Away hk │"
crlf
print "hk │w I - cBANG Info hk │"
crlf
print "hk │w V - rView Victimshk │"
# SysOp option to edit the BANG.LOG file. Makes maintenance easy.
compare_ars SYSOP
if_true
crlf
print "hk │w E - yEdit Log hk │"
end_if
crlf
print "hk │w Q - gQuit to the BBS r∙"
crlf
print "n │hw r¡"
crlf
print "n └──wh──>"
# Get in Sync before getting user input
node_action node_xtrn
sync
# Get User Input
getcmd efiqv?
# Re-display Menu
cmdkey ?
cmd_pop
goto top
end_cmd
# Quit BANG
cmdkey q
cmd_pop
goto leave
end_cmd
# View BANG.LOG
cmdkey v
cls
crlf
print "hm───────────────────────────y│w5 Recent Bang Activity nhy│m───────────────────────────n"
crlf
chkfile "c:\sbbs\bang.log"
if_true
setstr "c:\\sbbs\\bang.log"
# Only view last 16 lines. (To avoid users getting angry at large logs)
printtail str 0 16
crlf
else
print "yh No one has played yet, or the SysOp has screwed up somewhere."
crlf
end_if
print "hm──────────────────────────────────────────────────────────────────────────────n"
crlf
pause
cmd_pop
goto top
end_cmd
# Info Menu. Please give credit where credit is due. Thanks.
cmdkey i
cls
print "ònh Chuckle Box BANG - Ver 2.1"
crlf
print " yfor SBBS 2.20 B, by Robert Nykvist"
crlf
print "c The Chuckle Box BBS @ (334) 653-1888"
crlf
crlf
print "hg Just like Russian Roulette,y BANGg is a very stupid, high risk game!"
crlf
crlf
print " ncThis BBS's hy357 Magnum nchas hysix ncchambers."
crlf
crlf
print "ch Survive round 1: +50 k"
crlf
print " Survive round 2: +100 k"
crlf
print " Survive round 3: +250 k"
crlf
print " Survive round 4: +500 k"
crlf
print " Survive round 5: +1000 k"
crlf
crlf
print " nhirWARNINGn"
crlf
crlf
print "wh If you pull trigger with bullet in a round, you lose Big Time!"
crlf
print "hm -200 k rcredits."
print "hm -30 rminutes from time bank."
print " BBS thenm hangs-upr on you!"
crlf
crlf
print "ch NEVER ncstick a gun to your head, or BBS. <Chuckle>"
crlf
crlf
print " @PAUSE@"
cmd_pop
goto top
end_cmd
# Edit Function for SysOp
cmdkey E
compare_ars SYSOP
if_true
setstr "c:\\sbbs\\bang.log"
ungetstr
edit_text_file
cmd_pop
goto top
end_if
end_cmd
# Fire the Gun. (PLAY GAME) Initialize Variables.
cmdkey f
set COUNT 0
set CHAMBER 0
set ROUNDS 0
# Use Random function to put bullet in this CHAMBER (1-6)
random CHAMBER 6
add CHAMBER 1
cls
crlf
print "yhLoading bOne yBullet into the Gun."
crlf
crlf
print "rhPull trigger how many times?y (w1-5y)r : "
sync
# How many times to pull trigger? (Rounds to shoot)
getnum ROUNDS 5
crlf
# Pressing "Q" sometimes gave a "negative" (-1) number and
# locked script in a non-stop loop. This prevents negative number lockups.
compare ROUNDS 0
if_less_or_equal
cmd_pop
goto top
end_if
# Display formality - Send User "Time" or "Times?"
add TRACKPLAY 1
compare ROUNDS 1
if_true
printf "mhPulling triggery %1ld mtime..." ROUNDS
crlf
crlf
print "whAiming at gYOURh head @USER@, cocking hammer back...yReady?"
crlf
crlf
pause
else
printf "mhPulling triggery %1ld mtimes..." ROUNDS
crlf
crlf
print "whAiming at gYOUR whead @USER@, cocking hammer back...yReady?"
crlf
crlf
pause
end_if
# Pulls of the trigger compared to chamber with bullet in it.
# If number of pulls IS LESS than the bullet chamber, user LIVES.
compare ROUNDS CHAMBER
if_less
:LIVES
# Loop to display the number of rounds user shot.
compare COUNT ROUNDS
if_true
cmd_pop
goto doneloop
end_if
switch COUNT
case 0
# Send remote caller an ASCII Bell for each shot fired & adjust credits.
# You may wish to change the credit amounts here. Be sure to change
# the info menu to reflect any changes here.
print_remote ""
print "hrCLICK! ;; b(W h e w!)"
crlf
adjust_user_credits 50
add WINNINGS 50
end_case
case 1
print_remote ""
print "hgCLICK! ;; b(W h e w! You are a brave person!)"
crlf
adjust_user_credits 100
add WINNINGS 100
end_case
case 2
print_remote ""
print "hyCLICK! ;; b(J e e s h! Three rounds? You gotta be nuts!)"
crlf
adjust_user_credits 250
add WINNINGS 250
end_case
case 3
print_remote ""
print "hcCLICK! ;; b(Y e o w! 4 squeezes? You must wanna logoff!)"
crlf
adjust_user_credits 500
add WINNINGS 500
end_case
case 4
print_remote ""
print "hmCLICK! ;; b(W O W! You got big nads or are suicidal!)"
crlf
adjust_user_credits 1000
add WINNINGS 1000
# If User Pulls Trigger 5 times and Lives, Let's log it with special entry!
FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\bang.log"
str one two three four
set one "hmCrazy w"
fprintf file "%s" one
fwrite file _useron.alias
set two " msurvived rhi5nhm clicks on y"
fprintf file "%s" two
int t
time t
time_str str t
shift_str 4
fprintf file "%s.\r\n" str
FCLOSE file
end_case
end_switch
crlf
pause
# Adding one to COUNT - keeps track of which case feedback to send.
add COUNT 1
cmd_pop
goto LIVES
else
# If the number of pulls equals or exceeds bullet chamber number, SPLAT!
:SPLAT
# Using Count Loop to determine WHEN to send the user their DEATH info.
add COUNT 1
# Only when count=chamber, bullet is in chamber, do we KILL the User!
compare COUNT CHAMBER
if_equal
# Note: Minute subtraction is from TIME bank, not present on-line time.
adjust_user_credits -200
sub WINNINGS 200
adjust_user_minutes -30
# Append Log with info of another Victim.
FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\bang.log"
str one two five
set one "wh"
fprintf file "%s" one
fwrite file _useron.alias
set two " ncdied after mh"
fprintf file "%s" two
copy str trackplay
compare trackplay 1
if_equal
fprintf file "%s ncplay rh" str
else
fprintf file "%s ncplays rh" str
end_if
int t
time t
time_str str t
shift_str 4
fprintf file "%s" str
# Determine Credit status. Credit loses in Red. Credit wins in White.
compare winnings 0
if_greater_or_equal
set five ".w +"
fprintf file "%s" five
copy str winnings
fprintf file "%s k\r\n" str
else
set five ".r "
fprintf file "%s" five
copy str winnings
fprintf file "%s k\r\n" str
end_if
FCLOSE file
# Use ARS security for salvation to valued callers. <Chuckles>
compare_ars level 50
if_true
cmd_pop
goto lucky
end_if
# Anyone who plays Russian Roulette or BANG is plain Stoopid!
print "chBANG! ;; r SPLAT... ;; g T,H,U,D,!"
crlf
crlf
print "ch,You bblewc your connection y@USER@! c Whadda rBloodyc Mess!"
crlf
crlf
print "hw,You have just fallen down and you can't get up.b HaHa!"
crlf
crlf
print "hr,Confiscating earned credits, and taking 200 k more!b"
crlf
crlf
print "m,Subtracting y30 mminutes from your Time Bank if any was deposited!"
crlf
crlf
print "Call again...for some more fun!...gGoodbye for now..."
crlf
crlf
pause
hangup
cmd_pop
goto byebye
else
# This loop is merely feedback to the User for each round shot, until
# they reach the chamber with the bullet in it...
switch COUNT
case 1
print_remote ""
print "hrCLICK! ;; b(W h e w!)"
crlf
end_case
case 2
print_remote ""
print "hgCLICK! ;; b(W h e w! You are a brave person!)"
crlf
end_case
case 3
print_remote ""
print "hyCLICK! ;; b(J e e s h! Three rounds? You gotta be nuts!)"
crlf
end_case
case 4
print_remote ""
print "hcCLICK! ;; b(Y e o w! 4 squeezes? You must wanna logoff!)"
crlf
end_case
# User should never be presented with Case 5, but I added it just in case.
case 5
print_remote ""
print "hmCLICK! ;; b(W O W! You got big nads or you are suicidal!)"
crlf
print "\r\nyi*nhwBONUSyi* nch100k ncCredits!"
crlf
end_case
end_switch
crlf
pause
cmd_pop
goto SPLAT
# Ending Compare/Count Chamber Loop
end_if
# Ending Rounds Chamber Loop
end_if
cmd_pop
goto top
# Ending Fire Command
end_cmd
# Fall through Just in Case
cmd_pop
goto top
# Done Loop - Send them feedback about their Credits.
:doneloop
compare COUNT 1
if_equal
print "chYou took a risk and mlived! c Congratulations!"
crlf
crlf
print "hgAddingy 50 k gCredits to your Account!"
crlf
end_if
compare COUNT 2
if_equal
print "chYou took a BIG risk and msurvived! c Congratulations!"
crlf
crlf
print "hgAddingy 150 k gCredits to your Account!"
crlf
end_if
compare COUNT 3
if_equal
print "chYou took a HUGE risk and mare still alive! c Congratulations!"
crlf
# Credits are SUM TOTALS of each round shot.
crlf
print "hgAddingy 400 k gCredits to your Account!"
crlf
end_if
compare COUNT 4
if_equal
print "chYou took a SUPER BIG risk and msurvived! c Congratulations!"
crlf
crlf
print "hgAddingy 900 k gCredits to your Account!"
crlf
end_if
compare COUNT 5
if_equal
print "chYou took a AWESOME risk and mlived! c Congratulations!"
crlf
crlf
print "hgAddingy 1900 k gCredits to your Account!"
crlf
end_if
crlf
pause
cmd_pop
goto top
# For those Users with high enough security level to avoid the hangup.
:lucky
print "chYou just rblewc your connection g@USER@! c But because of your high"
crlf
print "security level though, you were mNOTc disconnected from the BBS."
crlf
crlf
pause
cmd_pop
goto byebye
:leave
# If TRACKPLAY equals 0, they didn't play. No need to append the
# BANG.LOG file for a user who didn't play. Otherwise, log activity
# which includes User, Times played, Date/Time, and Credit result info.
compare trackplay 0
if_equal
cmd_pop
goto byebye
end_if
FOPEN file O_CREAT|O_WRONLY|O_APPEND "c:\sbbs\bang.log"
str uno dos
set uno "wh"
fprintf file "%s" uno
fwrite file _useron.alias
copy str trackplay
# Display formality. Time played, or Times played?
compare trackplay 1
if_equal
fprintf file "nc played mh%s nctime yh" str
else
fprintf file "nc played mh%s nctimes yh" str
end_if
int t
time t
time_str str t
shift_str 4
fprintf file "%s" str
set dos "nc. Results: wh+"
fprintf file "%s" dos
copy str winnings
fprintf file "%s k\r\n" str
FCLOSE file
:byebye